package com.cooud.product.service.impl;

import com.cooud.product.bean.Product;
import com.cooud.product.service.ProductService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: DongGuoZhen
 * @Date: 2025/03/12/19:44
 * @Description:
 */
@Service
@Slf4j
public class ProductServiceImpl implements ProductService {
    @Override
    public Product getProduct(Long productId) {
        log.info("接收到请求，productId={}", productId);
        Product product = new Product();
        product.setId(productId);
        product.setProductName("productName");
        product.setPrice(new BigDecimal("100"));
        product.setNum(10);
//        try {
//            TimeUnit.SECONDS.sleep(100);
//        } catch (InterruptedException e) {
//            throw new RuntimeException(e);
//        }
        return product;
    }
}
